#ifndef OBJECTMANAGER_H_
#define OBJECTMANAGER_H_

#include <map>
#include <vector>
#include "Network.h"
#include "Message.h"
#include <boost/asio.hpp>			

class ObjectManager 
{

public:
	ObjectManager();
	~ObjectManager();

	static int nextPos;

	static std::map<int,ObjectMessage*> outgoingMessageMap;
	static std::map<int,ObjectMessage*> incomingMessageMap;
	static std::vector<PlayerEnterMessage*> players;

	static ObjectMessage* createObject();
	static PlayerEnterMessage* createPlayerEnterMessage(std::string name);
	static PlayerLeaveMessage* createPlayerLeaveMessage(int id);

	static void receiveObjectMessage(ObjectMessage *receivedMessage);
	static void sendObjectMessage(ObjectMessage *changedMessage, boost::asio::ip::udp::endpoint destination);
	static std::map<int, ObjectMessage*>::const_iterator getOutgoingMessageMapBegin();
	static std::map<int, ObjectMessage*>::const_iterator getOutgoingMessageMapEnd();
	static std::map<int, ObjectMessage*>::const_iterator getIncomingMessageMapBegin();
	static std::map<int, ObjectMessage*>::const_iterator getIncomingMessageMapEnd();
};

#endif /*OBJECTMANAGER_H_*/